from utils.operators.latest_only_spark_submit_operator import LatestOnlySparkSubmitOperator

jms_audit_info__ranger_audit_info_dt = LatestOnlySparkSubmitOperator(
    task_id='jms_audit_info__ranger_audit_info_dt',
    conn_id='spark_default',
    pool_slots=1,
    # depends_on_past=True,  # 如果任务依赖于前一天的同名任务，则将 depends_on_past 设为 True
    task_concurrency=1,  # 如果任务不支持并发，则将 task_concurrency 设为 1
    name='jms_audit_info__ranger_audit_info_dt_{{ execution_date | date_add(1) |cst_ds }}',  # yarn 任务名称
    driver_memory='2G',
    executor_memory='4G',
    executor_cores=2,
    retries=0,
    num_executors=8,
    email=['zhangqinglin@jtexpress.com','yl_bigdata@yl-scm.com'],
    conf={'spark.executor.memoryOverhead': 2048,
          'spark.core.connection.ack.wait.timeout': 3000,
          'spark.default.parallelism': 600,
          'spark.locality.wait': 60,
          },
    java_class='com.jms.yl.audit.ProcessRangerAudit',  # spark 主类
    application='hdfs:////scheduler/jms/spark/sj/ranger_audit_info_dt/batch_process-1.0-SNAPSHOT-jar-with-dependencies.jar',
    # spark jar 包
    application_args=['{{ execution_date | cst_ds_nodash }}'],  # 参数dt 20201026
)
